home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Technical.Notes / Misc / TN.MISC.012 < prev    next >
Encoding:
Text File  |  1990-01-23  |  2.3 KB  |  50 lines  |  [TEXT/pdos]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6.  
  7. Apple II Miscellaneous
  8. #12:    The Apple II Firmware WAIT Routine
  9.  
  10. Revised by:    Matt Deatherage                                  November 1988
  11. Written by:    Matt Deatherage                                       May 1988
  12.  
  13. This Technical Note expands on the already documented descriptions of the 
  14. Apple II firmware WAIT routine, which guaranteed a minimum, not an exact, 
  15. specified delay.
  16. _____________________________________________________________________________
  17.  
  18. As described in the Apple IIe Technical Reference Manual and the Apple IIc 
  19. Technical Reference Manual, Second Edition, the WAIT routine located in ROM
  20. at $FCA8 waits for a certain amount of time before returning to the calling
  21. program.  The delay is listed in the IIe manual as being 1/2(26+27A+5A^2),
  22. where A is the value in the accumulator when WAIT is called.  The value
  23. returned by this expression is the number of clock cycles taken by the
  24. routine, not the amount of time that passes while it waits.  To obtain the
  25. elapsed time in microseconds, you must multiply the result by the scaling
  26. factor 14 / 14.318181.
  27.  
  28. Different formulas have appeared in different firmware listings published by 
  29. Apple in the past, but the above formula is in all current publications, and 
  30. has been verified as correct by Developer Technical Support.  If there were 
  31. nothing in the system except a 65C02 (or 65816) microprocessor, this formula 
  32. would be completely accurate.  However, this is not the case in an Apple II, 
  33. as there are interrupts, changing system speeds, fast and slow RAM, and 
  34. numerous other additions to the system that can cause extra overhead when a 
  35. routine is executed.
  36.  
  37. For these reasons, the WAIT routine should be used only as a minimum delay.  
  38. It should not be expected to wait for exactly the time specified by the WAIT 
  39. formula.
  40.  
  41. The Apple IIGS Firmware Reference correctly notes this fact, as well as 
  42. including the scaling factor (14 / 14.318181) to return the minimum delay in 
  43. microseconds without further calculation.
  44.  
  45.  
  46. Further Reference
  47. o    Apple IIGS Firmware Reference
  48. o    Apple IIe Technical Reference Manual
  49. o    Apple IIc Technical Reference Manual, Second Edition
  50.